<%= render_partial 'forum/header' %>

<div class="topic-title">
    <h2><%=h @topic.name %></h2>
</div>

<%= render_partial 'forum/breadcrumbs' %>

<%= render_partial 'post_new_topic' %>
<%= render_partial 'post_new_reply' %>

<div class="posts">
	  <% for post in @posts %>
	  <div class="post">
	  <div class="post-title"><h3><%=h post.name %></h3></div>
	  <div class="post-content"><%=h post.content %></div>
	  <div class="post-author">
	  <span class="post-author-header">Author</span>
	  	  <%= post.user.login %>
	  </div>
	  <div class="post-author-details">
	  <span class="post-author-details-header">Author details</span>
	     Joined: <%= post.user.created_at.strftime('%b %d, %Y') %><br />Posts: <%= post.user.posts.size %>
        </div>
	  
	  <div class="post-date"><span class="post-date-header"><%= post.created_at.strftime('%b %d, %Y %I:%M %p') %></span></div>
	  </div>
		<% end %>
</div>

<%= render_partial 'post_new_topic' %>
<%= render_partial 'post_new_reply' %>

<%= render_partial 'forum/breadcrumbs' %>

<div class="posts-previous">
  <%= link_to 'Previous page', { :page => @post_pages.current.previous } if @post_pages.current.previous %>
</div>
<div class="posts-next">
  <%= link_to 'Next page', { :page => @post_pages.current.next } if @post_pages.current.next %> 
</div>  
